﻿Imports Microsoft.VisualBasic.ApplicationServices
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.CodeDom.Compiler
Imports System.ComponentModel
Imports System.Configuration
Imports System.Diagnostics
Imports System.Runtime.CompilerServices

Namespace Stickam_Client.My
    Friend NotInheritable Class MySettings
        Inherits ApplicationSettingsBase
        ' Methods
        Private Shared Sub AutoSaveSettings(ByVal sender As Object, ByVal e As EventArgs)
            If MyProject.Application.SaveMySettingsOnExit Then
                MySettingsProperty.Settings.Save
            End If
        End Sub


        ' Properties
        Public Shared ReadOnly Property [Default] As MySettings
            Get
                If Not MySettings.addedHandler Then
                    Dim addedHandlerLockObject As Object = MySettings.addedHandlerLockObject
                    ObjectFlowControl.CheckForSyncLockOnValueType(addedHandlerLockObject)
                    SyncLock addedHandlerLockObject
                        If Not MySettings.addedHandler Then
                            AddHandler MyProject.Application.Shutdown, New ShutdownEventHandler(AddressOf MySettings.AutoSaveSettings)
                            MySettings.addedHandler = True
                        End If
                    End SyncLock
                End If
                Return MySettings.defaultInstance
            End Get
        End Property

        Public Property DisabledPM As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("DisabledPM"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("DisabledPM") = Value
            End Set
        End Property

        Public Property FontBold As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("FontBold"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("FontBold") = Value
            End Set
        End Property

        Public Property FontColor As String
            Get
                Return Conversions.ToString(Me.Item("FontColor"))
            End Get
            Set(ByVal Value As String)
                Me.Item("FontColor") = Value
            End Set
        End Property

        Public Property FontElite As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("FontElite"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("FontElite") = Value
            End Set
        End Property

       Public Property FontFamily As String
            Get
                Return Conversions.ToString(Me.Item("FontFamily"))
            End Get
            Set(ByVal Value As String)
                Me.Item("FontFamily") = Value
            End Set
        End Property

         Public Property FontItalics As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("FontItalics"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("FontItalics") = Value
            End Set
        End Property

        Public Property FontSize As Integer
            Get
                Return Conversions.ToInteger(Me.Item("FontSize"))
            End Get
            Set(ByVal Value As Integer)
                Me.Item("FontSize") = Value
            End Set
        End Property

        Public Property FontUnderline As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("FontUnderline"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("FontUnderline") = Value
            End Set
        End Property


        Public Property HttpEnabled As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("HttpEnabled"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("HttpEnabled") = Value
            End Set
        End Property


        Public Property HttpIP As String
            Get
                Return Conversions.ToString(Me.Item("HttpIP"))
            End Get
            Set(ByVal Value As String)
                Me.Item("HttpIP") = Value
            End Set
        End Property


        Public Property InvertRGB As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("InvertRGB"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("InvertRGB") = Value
            End Set
        End Property


        Public Property Keywords As String
            Get
                Return Conversions.ToString(Me.Item("Keywords"))
            End Get
            Set(ByVal Value As String)
                Me.Item("Keywords") = Value
            End Set
        End Property


        Public Property LoginEmail As String
            Get
                Return Conversions.ToString(Me.Item("LoginEmail"))
            End Get
            Set(ByVal Value As String)
                Me.Item("LoginEmail") = Value
            End Set
        End Property


        Public Property LoginPass As String
            Get
                Return Conversions.ToString(Me.Item("LoginPass"))
            End Get
            Set(ByVal Value As String)
                Me.Item("LoginPass") = Value
            End Set
        End Property


        Public Property LoginRemember As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("LoginRemember"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("LoginRemember") = Value
            End Set
        End Property


        Public Property PlayKeywordSound As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("PlayKeywordSound"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("PlayKeywordSound") = Value
            End Set
        End Property


        Public Property PM_Mode As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("PM_Mode"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("PM_Mode") = Value
            End Set
        End Property


        Public Property ReverseRGB As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("ReverseRGB"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("ReverseRGB") = Value
            End Set
        End Property


        Public Property ShowData As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("ShowData"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("ShowData") = Value
            End Set
        End Property

        Public Property SocksHTTP As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("SocksHTTP"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("SocksHTTP") = Value
            End Set
        End Property

        Public Property SocksIP As String
            Get
                Return Conversions.ToString(Me.Item("SocksIP"))
            End Get
            Set(ByVal Value As String)
                Me.Item("SocksIP") = Value
            End Set
        End Property

        Public Property SocksRTMP As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("SocksRTMP"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("SocksRTMP") = Value
            End Set
        End Property

        Public Property SocksVersion As Integer
            Get
                Return Conversions.ToInteger(Me.Item("SocksVersion"))
            End Get
            Set(ByVal Value As Integer)
                Me.Item("SocksVersion") = Value
            End Set
        End Property

        Public Property StartupOp As Boolean
            Get
                Return Conversions.ToBoolean(Me.Item("StartupOp"))
            End Get
            Set(ByVal Value As Boolean)
                Me.Item("StartupOp") = Value
            End Set
        End Property

        Public Property StickamURL As String
            Get
                Return Conversions.ToString(Me.Item("StickamURL"))
            End Get
            Set(ByVal Value As String)
                Me.Item("StickamURL") = Value
            End Set
        End Property


        ' Fields
        Private Shared addedHandler As Boolean
        Private Shared addedHandlerLockObject As Object = RuntimeHelpers.GetObjectValue(New Object)
        Private Shared defaultInstance As MySettings = DirectCast(SettingsBase.Synchronized(New MySettings), MySettings)
    End Class
End Namespace

